package com.iplay.configuration.mail;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("feast-booking.mail")
public class MailConfigurationProperties {

	@Value("${spring.mail.username}")
	private String sender;

	public RegistrationEmail registrationEmail = new RegistrationEmail();

	public TotpEmail totpEmail = new TotpEmail();

	public OrderCreatedEmail orderCreatedEmail = new OrderCreatedEmail();

	public class RegistrationEmail {
		private String subject = "FeastBooking 驗證碼";
		private String content = "您的驗證碼為：{totp}  此驗證碼2分鐘内有效。";

		public String getSubject() {
			return subject;
		}

		public void setSubject(String subject) {
			this.subject = subject;
		}

		public String getContent() {
			return content;
		}

		public void setContent(String content) {
			this.content = content;
		}

	}

	public class TotpEmail {
		private String subject = "FeastBooking 驗證碼";
		private String content = "您的驗證碼為：{totp}  此驗證碼2分鐘内有效。";

		public String getSubject() {
			return subject;
		}

		public void setSubject(String subject) {
			this.subject = subject;
		}

		public String getContent() {
			return content;
		}

		public void setContent(String content) {
			this.content = content;
		}
	}

	public class OrderCreatedEmail {
		private static final String MAIL_LINE_SEPERATOR = "\n";

		private String subject = "FeastBooking 通知邮件";
		private String content = "您有一个新的咨询单！您在此咨询单中角色是%s。咨询单详情：" + MAIL_LINE_SEPERATOR + "用户：%s" + MAIL_LINE_SEPERATOR
				+ "酒店：%s" + MAIL_LINE_SEPERATOR + "宴会厅：%s" + MAIL_LINE_SEPERATOR + "桌数：%s" + MAIL_LINE_SEPERATOR
				+ "日期：%s" + MAIL_LINE_SEPERATOR + "推介人：%s" + MAIL_LINE_SEPERATOR + "联系人：%s" + MAIL_LINE_SEPERATOR
				+ "联系方式：%s" + MAIL_LINE_SEPERATOR;

		public String getSubject() {
			return subject;
		}

		public void setSubject(String subject) {
			this.subject = subject;
		}

		public String getContent() {
			return content;
		}

		public void setContent(String content) {
			this.content = content;
		}
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public RegistrationEmail getRegistrationEmail() {
		return registrationEmail;
	}

	public void setRegistrationEmail(RegistrationEmail registrationEmail) {
		this.registrationEmail = registrationEmail;
	}

	public TotpEmail getTotpEmail() {
		return totpEmail;
	}

	public void setTotpEmail(TotpEmail totpEmail) {
		this.totpEmail = totpEmail;
	}
}
